package mysrpringboot.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;





@SpringBootApplication
@EnableScheduling
@EnableCaching
//@ComponentScan(basePackages = {"mysrpringboot.springboot.redisConfig"})
//不配这个，拦截器是启动不了的
public class ApplicationSpringboot extends SpringBootServletInitializer  {
    @Override//不这样配，打成war项目跑不起来
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
    {
        return application.sources(ApplicationSpringboot.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(ApplicationSpringboot.class, args);
    }

   /* @Override//不写会加载不了resources的静态资源
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        WebMvcConfigurer.super.addResourceHandlers(registry);
    }*/
   

}
